package com.qys.livesMall.file.server.upload.enums;


import java.util.Objects;

public enum FileEnum {
    USER_IMG("user_img","/user/#{[userIdTop2]}/#{[userId]}/user_img/","用户图片"),
    USER_TOP_IMG("user_top_img","/user/#{[userIdTop2]}/#{[userId]}/user_top_img/","用户头像"),
    SYS_USER_TOP_IMG("sys_user_top_img","/sys_user/user_top_img/","系统用户头像"),
    SHOP_IMG("shop_img","/user/#{[userIdTop2]}/#{[userId]}/shop/shop_img/","店铺图片"),

    PRODUCT_GOODS_IMG("product_goods_img","/product/#{[datePath]}/","商品图片"),

    SHORT_VIDEO("short_video","/video/#{[datePath]}/","视频相关"),

    SYS_OTHER("sys_other","/sys/other/#{[datePath]}/","系统杂项"),
    SHORT_VIDEO_IMG("short_video","/video/img/#{[datePath]}/","视频抽帧图片"),
    ;
    private String type;

    private String path;

    private String desc;

    FileEnum(String type, String path, String desc){
        this.type=type;
        this.path=path;
        this.desc=desc;
    }

    public String getType() {
        return type;
    }

    public String getPath() {
        return path;
    }

    public String getDesc() {
        return desc;
    }

    public static FileEnum getByType(String type){
        for(FileEnum fileEnum:FileEnum.values()){
            if (Objects.equals(fileEnum.getType(),type)){
                return fileEnum;
            }
        }
        return null;
    }
}
